home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Languages / MacGofer 0.22d / MacGofer Sources / output.c < prev    next >
Encoding:
Text File  |  1993-08-25  |  26.3 KB  |  83 lines  |  [TEXT/MPS ]

  1. /* --------------------------------------------------------------------------
  2.  * output.c:    Copyright (c) Mark P Jones 1991-1993.   All rights reserved.
  3.  *              See goferite.h for details and conditions of use etc...
  4.  *              Gofer version 2.28 January 1993
  5.  *
  6.  * Unparse expressions and types - for use in error messages, type checker
  7.  * and for debugging.
  8.  * ------------------------------------------------------------------------*/
  9.  
  10. #ifndef  GOFC_OUTPUT
  11. #include "prelude.h"
  12. #include "storage.h"
  13. #include "connect.h"
  14. #include "errors.h"
  15.  
  16. #if MPW
  17. #include "mac_ctype.h"        /* We need our special ctype macros for the Mac */
  18. #pragma segment Output
  19.  
  20. #else
  21. #include <ctype.h>
  22. #endif
  23.  
  24. #endif
  25.  
  26. Bool traceEval = FALSE;        /* TRUE => display evaluation */
  27.  
  28. /* --------------------------------------------------------------------------
  29.  * Local function prototypes:
  30.  * ------------------------------------------------------------------------*/
  31.  
  32. static Void local putChr     Args((Int));
  33. static Void local putStr     Args((String));
  34. static Void local putInt     Args((Int));
  35. static Void local indent     Args((Int));
  36.  
  37. static Void local put             Args((Int,Cell));
  38. static Void local putComp     Args((Cell,List));
  39. static Void local putQual        Args((Cell));
  40. static Bool local isDictVal     Args((Cell));
  41. static Cell local maySkipDict     Args((Cell));
  42. static Void local putAp         Args((Int,Cell));
  43. static Void local putOverInfix   Args((Int,Text,Syntax,Cell));
  44. static Void local putInfix     Args((Int,Text,Syntax,Cell,Cell));
  45. static Void local putSimpleAp     Args((Cell));
  46. static Void local putTuple     Args((Int,Cell));
  47. static Int  local unusedTups     Args((Int,Cell));
  48. static Void local unlexVar     Args((Text));
  49. static Void local unlexOp     Args((Text));
  50. static Void local unlexCharConst Args((Cell));
  51. static Void local unlexStrConst     Args((Text));
  52.  
  53. #ifdef GOFC_OUTPUT
  54. static Void local pPut         Args((Int,Cell,Int));
  55. static Void local pPutAp     Args((Int,Cell,Int));
  56. static Void local pPutSimpleAp     Args((Cell,Int));
  57. static Void local pPutTuple     Args((Int,Cell,Int));
  58. static Int  local punusedTups     Args((Int,Cell,Int));
  59. static Void local pPutOffset     Args((Int));
  60. static Int  local pPutLocals     Args((List,Int));
  61. static Void local pLiftedStart     Args((Cell,Int,String));
  62. static Void local pLifted     Args((Cell,Int,String));
  63. static Int  local pDiscr     Args((Cell,Int));
  64. #endif
  65.  
  66. static Void local putSigType     Args((Cell));
  67. static Void local putContext     Args((List));
  68. static Void local putPred     Args((Cell));
  69. static Void local putType     Args((Cell,Int));
  70. static Void local putTyVar     Args((Int));
  71. static Bool local putTupleType   Args((Cell));
  72. static Void local putApType     Args((Type));
  73.  
  74. static Void local putKind     Args((Kind));
  75. static Void local putSig     Args((Cell));
  76.  
  77. /* --------------------------------------------------------------------------
  78.  * Basic output routines:
  79.  * ------------------------------------------------------------------------*/
  80.  
  81. static FILE *outputStream;        /* current output stream       */
  82. static Int  outColumn = 0;        /* current output column number       */
  83. Bool   showDicts = FALSE;